import time 

f1 = open("m1_sorted.txt")  

a1 = [int(i) for i in f1]

start = time.time()

n = len(a1)

for i in range(n-1):

    for j in range (n-2,i-1, -1):

       if a1[j]>a1[j+1]:

            a1[j], a1[j+1]=a1[j+1],a1[j]

finish = time.time()

print('m1_sorted', round((finish - start)*1000), 'milliseconds')

f2 = open('m2_reverse.txt') 

a2 = [int(i) for i in f2]

start = time.time()

n = len(a2)

for i in range(n-1):

    for j in range (n-2,i-1, -1):

        if a2[j]>a2[j+1]:

            a2[j], a2[j+1]=a2[j+1],a2[j]

finish = time.time()

print('m2_reverse', round((finish - start)*1000), 'milliseconds')

f3 = open('m3_shuffle.txt') 

a3 = [int(i) for i in f3]

start = time.time()

n = len(a3)

for i in range(n-1):

    for j in range (n-2,i-1, -1):

        if a3[j]>a3[j+1]:

            a3[j], a3[j+1]=a3[j+1],a3[j]

finish = time.time()

print('m3_shuffle', round((finish - start)*1000), 'milliseconds')
